package cn.zengchen233.web;

import cn.zengchen233.config.SpringConfiguration;
import cn.zengchen233.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author zengchen
 * @title UserController
 * @description TODO
 * @create 2023/1/7 15:46
 */
public class UserController {
    @Test
    public void test1() {
        //ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
        ApplicationContext app = new AnnotationConfigApplicationContext(SpringConfiguration.class);
        //UserService bean = (UserService) app.getBean("userService");
        UserService bean = app.getBean(UserService.class);
        bean.save();
    }

}
